﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using CommonFunc;

public partial class Control_AddGBook : System.Web.UI.UserControl
{
    MODEL.GBook MGB = new MODEL.GBook();

    BLL.GBook BGB = new BLL.GBook();

    protected void Page_Load(object sender, EventArgs e)
    {

    }


    #region 添加留言
    protected void Btn_Submit_Click(object sender, EventArgs e)
    {
        try
        {
            MGB.GBook_Content = CommonFunction.CharConvert(TB_Content.Text);
            MGB.GBook_DateTime = DateTime.Now;
            MGB.GBook_Email = TB_Email.Text;
            MGB.GBook_IP = Request.ServerVariables["Remote_Addr"];
            MGB.GBook_Name = TB_Name.Text;
            MGB.GBook_QQ = TB_QQ.Text;
            MGB.GBook_State = true;
            MGB.GBook_Telephone = TB_Tel.Text;
            MGB.GBook_Title = TB_Title.Text;
            MGB.GBook_Reply = "";

            BGB.Add(MGB);

            Response.Redirect("GBook.aspx");
        }
        catch (Exception ex)
        {
            LB_AddGBook.Text = ex.Message;
        }
    }
    #endregion
}
